package com.woniuxy.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.woniuxy.entity.OrderItem;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 订单明细Mapper接口
 */
public interface OrderItemMapper extends BaseMapper<OrderItem> {

    /**
    * @description: 根据订单id查询订单详细
     * @param id:
     * @return: com.woniuxy.entity.OrderItem
     * @date: 2021/8/12 14:12
     * @author: 魏炳豪
     */
    @Select("select * from gfr_order_item where orderId=#{id}")
    List<OrderItem> getByOrderId(int id);

   @Insert("insert into gfr_order_item (orderId,dishId,dish_num,price,description) values(#{orderId},#{dishId},#{dishNum},#{price},#{description})")

    void adds(OrderItem orderItem);



}
